package com.normalsys.live.service;

import com.normalsys.live.base.config.ResponseCode;
import com.normalsys.live.base.exp.BizException;
import com.normalsys.live.dao.UserDAO;
import com.normalsys.live.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

/**
 * Project Name: testlive
 * File Name: LiveService
 * Package Name: com.normalsys.live.service
 * Date: 2018/9/10  13:09
 * Copyright (c) 2018, tianyul All Rights Reserved.
 */
@Service
public class LiveService {

    @Autowired
    private UserDAO userDAO;

    /**
     * 获得开播信息
     * @param id
     * @return
     */
    public Map<String,Object> getAnchorInfo(Long id) {
        Map<String,Object> result = new HashMap<>();

        User user = userDAO.selectByPrimaryKey(id);
        if(null == user) {
            throw new BizException(ResponseCode.PARAM_ILLEGAL_ERROR, "当前用户不存在");
        }



        return result;
    }
}
